package com.kgc.personprovider.dao;

import com.kgc.personcommon.pojo.Permission;
import com.kgc.personcommon.pojo.Role;
import com.kgc.personcommon.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {
    List<User> getAll(Map<String, Object> params);
    int getCount(Map<String, Object> params);
    int addUser(User user);
    int updateUser(User user);
    int deleteUser(String id);
    User getUserById(String id);
    List<User> getAllUsers(Map<String, Object> params);
    int delUserRoleByUser(String uid);
    int addUserRole(Map<String, Object> m);
    List<Role> getRolesByUser(String uid);
    User login(String account);
    List<String> getPurlByUser(String account);
    User getUserByAccount(String account);
    User findUserWithRolesAndPermissions(String account);
    List<Permission> findPermissionsByUserId(@Param("userId") String userId);
    List<Permission> findMenuPermissionsByUser(@Param("account") String account);
    List<String> getApiPathsByUser(@Param("account") String account);
    List<Permission> findChildPermission(@Param("value") String pid);

    List<User> selectUserByMap(Map<String, Object> params);
}
